##### This script lists the dates of N days from a starting point specified.
## The result is displayed in a CSV File in the format %Y-%m-%d

import sys
import datetime

# Read command line arguments
[startDate, NumDays, outputFile] = sys.argv[1:4]

startDate = datetime.datetime.strptime(startDate, '%Y-%m-%d')
NumDays = int(NumDays)

fout = open(outputFile, 'w')
fout.write('Date\n')
for ii in range(NumDays):
    myday = startDate + datetime.timedelta(days=ii)
    mydayStr = myday.strftime('%Y-%m-%d')
    fout.write(mydayStr + "\n")

fout.close()
